<?php 
    $flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
    
    if($flashMessenger->setNamespace('success')->hasMessages()){?>

        <?php foreach ($flashMessenger->getMessages() as $msg): ?>
            <span style="font-weight: bold">
                <?php  echo $msg ?>
                <br/>
            </span>
        <?php endforeach; ?>
<?php } ?>
<h1>Personel Details</h1>
<fieldset class="prodata">
    <legend>Details</legend>
 
    Name: <?php  echo $this->userData->FirstName, ' ' , $this->userData->MiddleName, ' ', $this->userData->LastName     ?><br />
    DOB: <?php   echo $this->userData->DateOfBirth   ?><br />
    Gender: <?php  if($this->userData->Gender == 1 ) echo 'Male'; elseif($this->userData->Gender == 2 ) echo 'Female';   ?><br />
    Permanent Account Number: <?php   echo $this->userData->PermanentAccountNumber   ?><br />
    Mobile Number: <?php   echo $this->userData->MobileNumber   ?><br />
    <div class="right"><a href="/edit-profile">Edit</a></div>
</fieldset>


<fieldset class="prodata marLt25">
    <legend>Password</legend>
    
    <form action="main/profile/changepassword" method="post" name="password-form" id="password-form">
        <label for="RecentPhoto">Current Password</label>
        <input type="password" name="CurrentPassword" id="CurrentPassword" value="" class="validate[required] frmInput">
        <label for="RecentPhoto">New Password</label>
        <input type="password" name="Password" id="Password" value="" class="validate[required] frmInput">
        <label for="RecentPhoto">Confirm Password</label>
        <input type="password" name="ConfirmPassword" id="ConfirmPassword" value="" class="validate[required,equals[Password]] frmInput">

        <div class="frm_row">
            <input type="submit" value="Change Password" class="submitBtn">
        </div>
    </form>


<script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery("#password-form").validationEngine();
        });
</script>


</fieldset>

<br /><br />

<fieldset class="prodata">
    <legend>Full Address</legend>
    
    <?php
        if(count($this->Addresses) > 0){
            foreach($this->Addresses as $temp){
                if(!empty($temp) )
                {
                    echo 'Address Type : ' . $temp['address_type'];

                    echo $temp['AddressLine1'], ', ', $temp['AddressLine2'], ', ', $temp['AddressCity'],
                        ', ', $temp['AddressState'], ', ', $temp['AddressCountry'], ', ', $temp['AddressPIN'];

                    echo '<br>Phone: ', $temp['AddressPhone1'], ', ', $temp['AddressPhone2'];
                }
            }
        }else
        {
            echo 'Sorry! You haven\'t added your address';
            echo '<br><br><div class="right"><a href="/add-address">Add Addresss Now</a></div>';
        }
    
    ?>
</fieldset>

<fieldset class="prodata">
    <legend>Correspondence Address</legend>

    <?php
        if(!empty($this->CorAdd) )
        {
            echo $this->CorAdd->AddressLine1, ', ', $this->CorAdd->AddressLine2, ', ', $this->CorAdd->AddressCity,
                ', ', $this->CorAdd->AddressState, ', ', $this->CorAdd->AddressCountry, ', ', $this->CorAdd->AddressPIN;

            echo '<br>Phone: ', $this->CorAdd->AddressPhone1, ', ', $this->CorAdd->AddressPhone2;
        }
        else
        {
            echo 'Sorry! You haven\'t added your Correspondence Address';
            echo '<br><br><div class="right"><a href="/add-address">Add Addresss Now</a></div>';
        }
    ?>
</fieldset>

<fieldset class="prodata marLt25">
    <legend>Emergency Address</legend>

     <?php
        if(!empty($this->EmerAdd) )
        {
            echo $this->EmerAdd->AddressLine1, ', ', $this->EmerAdd->AddressLine2, ', ', $this->EmerAdd->AddressCity,
                ', ', $this->EmerAdd->AddressState, ', ', $this->EmerAdd->AddressCountry, ', ', $this->EmerAdd->AddressPIN;

            echo '<br>Phone: ', $this->EmerAdd->AddressPhone1, ', ', $this->EmerAdd->AddressPhone2;
        }
        else
        {
            echo 'Sorry! You haven\'t added your Emergency Address';
            echo '<br><br><div class="right"><a href="/add-address">Add Addresss Now</a></div>';
        }
    ?>
</fieldset>

<br />